#define _CRT_SECURE_NO_WARNINGS 1
int pivotIndex(int* nums, int numsSize) {
    int count = 0;
    int left_count = 0;
    for (int i = 0; i < numsSize;i++)
    {
        count += nums[i];
    }
    for (int i = 0; i < numsSize;i++)
    {
        if (2 * left_count + nums[i] == count)
        {
            return i;
        }
        left_count += nums[i];
    }
    return -1;
}